1. Field of the Invention
The present invention relates to the implementation of a battery State of Charge (SOC) estimator.
2. Background Art
Batteries are used in a wide variety of electronic and electrical devices. In each application, it is often useful and necessary to measure how much charge is left in the battery. Such a measurement is called the State of Charge (SOC). It is useful, for example, for a cell phone user to know how much longer he can talk on his phone. On the other hand, recharging devices need to know how much charge is in a battery to prevent overcharging. Many types of battery are sensitive to overcharging as well as undercharging. Overcharging and undercharging can erode the effectiveness of batteries and even damage them.
Currently there are many techniques that measure the remaining charge of a battery. Each of these SOC determination techniques has drawbacks. Some such as Ampere-hour counting are sensitive to measurement errors. Others such as Coup de fouet work for only One type of battery. Still other techniques such as Impedance Spectroscopy are constrained by battery conditions such as rapidly changing temperature. Also many do not give an uncertainty range in their estimation of the SOC. In applications such as HEV and EV batteries, the uncertainty range associated with the SOC measurement is very critical. Vehicles can lose power on the road and cause danger if the uncertainty range is unknown and the battery is erroneously undercharged. Knowing the uncertainty range can prevent this. For example if the battery SOC is determined to be within 10% of the minimum charge threshold and the uncertainty range is known to be 15%, the system will know to charge the battery because the uncertainty range is greater than the distance to the threshold.
Existing Techniques
Presented here is an overview of the existing techniques and some of their shortcomings. One technique called the discharge test is an accurate form of testing. It involves completely discharging the battery to determine the SOC under controlled conditions. However, the complete discharge requirement renders this test impractical for real-life application. It is too time consuming to be useful and interrupts system function while the test is being performed.
Another SOC determination technique is called Ampere-hour counting. This is the most common technique for determining the SOC because of its ease of implementation. It measures the current of the battery and uses the measurement to determine what the SOC is. Ampere-hour counting uses the following:                     SOC        =                              SOC            0                    +                                    1                                                C                  N                                ⁢                                  xe2x80x83                                                      ⁢                          xe2x80x83                        ⁢                                          ∫                0                                  xe2x80x83                                            ⁢                                                (                                                            I                      batt                                        -                                          I                      loss                                                        )                                ⁢                                  xe2x80x83                                ⁢                                  ⅆ                  t                                                                                        (        1        )            
where CN is the rated capacity of the battery, Ibatt is the battery current, and Iloss is the current consumed by the loss reactions. The equation determines the SOC based on an initial SOC0 starting point. Ampere-hour counting is essentially an xe2x80x9copen loopxe2x80x9d method that is easily confused. Measurement error accumulates over time to degrade the accuracy of SOC determination. There are methods to improve current measurement but they are expensive.
Electrolyte Measurement is another common technique. In lead-acid batteries, for example, the electrolyte takes part in reactions during charge and discharge. Thus, a linear relationship exists between the change in acid density and the SOC. Therefore measuring the electrolyte density can yield an estimation of the SOC. The density is measured directly or indirectly by ion-concentration, conductivity, refractive index, viscosity, etc. However, this technique is only feasible for vented lead-acid batteries. Furthermore it is susceptible to acid stratification in the battery, water loss and long term instability of the sensors.
An open-circuit voltage measurement may be performed to test the SOC of the battery. Although the relationship between the open circuit voltage and the SOC is non-linear, it may be determined via lab testing. Once the relationship is determined, the SOC can be determined by measuring the open circuit voltage. However the measurement and estimation are accurate only when the battery is at a steady state, which can be achieved only after a long period of inactivity. This makes the open-circuit voltage technique impractical for dynamic real time application.
Impedance Spectroscopy is another technique used to determine the SOC. Impedance spectroscopy has a wide variety of applications in determining the various characteristics of batteries. Impedance Spectroscopy exploits a relationship between battery model parameters derived from impedance spectroscopy measurements and the SOC. However the drawback of this technique is that impedance curves are strongly influenced by temperature effects. Thus its application is limited to applications where temperature is stable.
Internal resistance is a technique related to impedance spectroscopy. Internal resistance is calculated as the voltage drop divided by the current change during the same time interval. The time interval chosen is critical because any time interval longer than 10 ms will result in a more complex resistance measurement. Measurement of internal resistance is very sensitive to measurement accuracy. This requirement is especially difficult to achieve in Hybrid Electric Vehicle (HEV) and Electric Vehicle (EV) applications.
Some techniques use non-linear modeling to estimate SOC directly from measurements. An example is artificial neural networks. Artificial neural networks operate on any system and predict the relationship between input and output. The networks have to be trained repeatedly so that it can improve its estimation. Because the accuracy of the data is based on the training program for the networks, it is difficult to determine the error associated with the SOC prediction given by artificial neural networks.
There is another group of SOC estimation techniques called the interpretive techniques. Interpretive techniques do not give SOC directly. Instead they use electrical discharge and charge characteristics to determine the SOC. As such, the SOC must be inferred from the calculated values. One of these techniques is called the Coup de fouet. Coup de fouet describes the short voltage drop region occurring at the beginning of discharge following a full charge of lead-acid battery. Using a special correlation between the voltage parameters occurring in this Coup de fouet region, the SOC can be inferred. One limitation of the Coup de fouet technique is that it works for lead-acid batteries only. Moreover it is effective only in cases where full charge is frequently reached during battery operations.
The Kalman Filter
One SOC determination technique involves mathematically modeling the behavior of the battery and predicting the SOC based on the model. One such model is the Kalman filter. It has mathematical basis in statistics, probabilities and system modeling. The main purpose of the Kalman filter is to predict recursively the internal states of a dynamic system using only the system""s outputs. In many instances this is very useful because the internal states of the system are unknown or cannot be directly measured. As such, the Kalman filter can work on all types of batteries and addresses a limitation of many aforementioned techniques.
The Kalman filter has been widely used in fields such as aerospace and computer graphics because it has several advantages over many other similar mathematical system models. In particular, the Kalman filter takes into account both measurement uncertainty and estimation uncertainty when it updates its estimation in successive steps. The Kalman filter corrects both uncertainties based on new measurements received from sensors. This is very important for two reasons. First, sensors often have a noise factor, or uncertainty, associated with its measurement. Over time, if uncorrected, the measurement uncertainty can accumulate. Second, in any modeling system the estimation itself has inherent uncertainty because the internal dynamic of the system may change over time. The estimation of one time step may be less accurate than the next because the system may have changed internally to behave less similarly to the model. The correction mechanism in the Kalman filter minimizes these uncertainties at each time step and prevents them from degrading accuracy over time.
FIG. 1. shows the basic operation of the Kalman filter. There are two main components in the Kalman filterxe2x80x94predict component 101 and correct component 102. To start, a set of initial parameters are fed into predict component 101. Predict component 101 predicts the internal states of the system at a particular point in time using a set of input parameters. Besides predicting the internal states, it also gives the uncertainty of its prediction. Thus, as shown in FIG. 1, the two outputs of predict component 101 are the predicted internal state vector (which encompasses the internal states) and its uncertainty.
The role of correct component 102 is to correct the predicted internal states and uncertainty it receives from predict component 101. The correction is made by comparing the predicted internal states and predicted uncertainty with new measurements received from sensors. The result are the corrected internal states and corrected uncertainty, both of which are then fed back as parameters to predict component 101 for the next iteration. At the next iteration, the cycle repeats itself over again.
Mathematical Basis of Kalman Filter
FIG. 1A and FIG. 1B show the equations used within both predict and correct components of the Kalman Filter. To understanding the origin of equations used, consider a dynamic process described by an n-th order difference equation of the form
yk+1=a0,kyk+ . . . +anxe2x88x921,kykxe2x88x92n+1+uk, kxe2x89xa70,xe2x80x83xe2x80x83(2)
where uk is a zero-mean white random process noise. Under some basic conditions, this difference equation can be re-written as                                                         x              ⇀                                      k              +              1                                ≡                      [                                                                                y                                          k                      +                      1                                                                                                                                        y                    k                                                                                                                    y                                          k                      -                      1                                                                                                                    ⋮                                                                                                  y                                          k                      -                      n                      +                      2                                                                                            ]                          =                                                                              [                                                                                                              a                                                      0                            ,                            k                                                                                                                                                a                                                      1                            ,                            k                                                                                                                      ⋯                                                                                              a                                                                                    n                              -                              2                                                        ,                            k                                                                                                                                                a                                                                                    n                              -                              1                                                        ,                            k                                                                                                                                                              1                                                                    0                                                                    ⋯                                                                    0                                                                    0                                                                                                            0                                                                    1                                                                    ⋯                                                                    0                                                                    0                                                                                                            ⋮                                                                    ⋮                                                                    ⋯                                                                    ⋮                                                                    ⋮                                                                                                            0                                                                    0                                                                    ⋯                                                                    1                                                                    0                                                                              ]                                ⏟                            A                        ⁢                          xe2x80x83                        ⁢                                                            [                                                                                                              y                          k                                                                                                                                                              y                                                      k                            -                            1                                                                                                                                                                                        y                                                      k                            -                            2                                                                                                                                                              ⋮                                                                                                                                      y                                                      k                            -                            n                            +                            1                                                                                                                                ]                                ⏟                                                              x                  ⇀                                k                                              +                                                                      [                                                                                    1                                                                                                            0                                                                                                            0                                                                                                            ⋮                                                                                                            0                                                                              ]                                ⏟                            B                        ⁢                          xe2x80x83                        ⁢                          u              k                                                          (        3        )            
in which {right arrow over (x)}k+1 represents a new state modeled by a linear combination of the previous state {right arrow over (x)}k and input uk. Note the notation of matrices A and B. This leads to the state-space model
{right arrow over (x)}k+1=Ak{right arrow over (x)}k+Bkukxe2x80x83xe2x80x83(4)
{right arrow over (y)}i=[1 0 . . . 0]{right arrow over (x)}ixe2x80x83xe2x80x83(5)
or the more general form
xe2x80x83{right arrow over (x)}k+1=Ak{right arrow over (x)}k+Bkukxe2x80x83xe2x80x83(6)
{right arrow over (y)}k=Ck{right arrow over (x)}k+Dkukxe2x80x83xe2x80x83(7)
which is the basis of many linear estimation models. While equations (3) to (5) assume a system with a single input and a single output, the general form in equations (6), (7) and the following equations allow multiple inputs and outputs if B has multiple columns and C has multiple rows.
Building on equations (6) and (7), the Kalman filter is governed by the equations
xk=Axkxe2x88x921+Bukxe2x88x921+wkxe2x88x921xe2x80x83xe2x80x83(8)
ykCxk+Duk+vk.xe2x80x83xe2x80x83(9)
Equation (9) is in a more general form, though D is often assumed to be 0. The matrices A and B in equation (8) relate to matrices Ak and Bk in equation (6), respectively. The matrices C and D in equation (9) relate to matrices Ck and Dk in equation (7). As equation (8) governs the estimation of the dynamic system process, it is called the process function. Similarly since equation (9) governs the estimation of the measurement uncertainty, it is called the measurement function. The added random variables wk and vk in equation (8) and (9) represent the process noise and measurement noise, respectively. Their contribution to the estimation is represented by their covariance matrices xcexa3w and xcexa3v in FIGS. 1A and 1B.
Referring again to FIG. 1A (which shows equations in predict component 101), equation 151 is based on equation (8) and equation 152 is based on in part on equation (9). Equation 151 takes closely after the form of equation (8) but the necessary steps to transform equation (9) into the form shown in equation 152 are not shown here. Equation 151 predicts the internal states of the system in the next time step, represented vector by {circumflex over (x)}k+1(xe2x88x92), using parameters from the current time step. The minus notation denotes that the vector is the result of the predict component. The plus notation denotes that the vector is the result of the correct component. Hence in equation 151, the result of the correct component in the current time step is used to predict the result for the next time step. Equation 152 predicts the. uncertainty, which is also referred to as the error covariance. As such, the matrix xcexa3w in equation 152 is the process noise covariance matrix.
FIG. 1B shows the equations within correct component 102. These three equations are executed in sequence. First, equation 161 determines the Kalman Gain factor. The Kalman Gain factor is used to calibrate the correction in equations 162 and 163. The matrix C in equation 161 is from that of equation (9), which relates the state to the measurement yk. In equation 162, the Kalman Gain factor is used to weight between actual measurement yk and predicted measurement C{circumflex over (x)}k(xe2x88x92). As shown in equation 161, matrix xcexa3v, the actual measurement-noise covariance, is inversely proportional to the Kalman Gain factor Lk. As xcexa3v decreases, Lk increases and gives the actual measurement yk more weight. However, if xcexa3e,k(+), the predicted uncertainty, decreases, Lk decreases and gives more weight to predicted measurement C{circumflex over (x)}k(xe2x88x92). Thus Kalman Gain factor favors either the actual measurement or predicted measurement, depending on which type of measurement has a smaller uncertainty.
Using this method of weighing measurement, equation 162 computes the corrected internal state vector {circumflex over (x)}k(+) based on predicted internal state vector {circumflex over (x)}k(xe2x88x92) (from predict component 101), new measurement yk and predicted measurement C{circumflex over (x)}k(xe2x88x92). Finally in the last equation of correct component 102, equation 163 corrects the predicted uncertainty, or the state-error covariance. Matrix I in equation 163 represents the identity matrix. The output of equations 162 and 163 are fed to predict component 101 for the next iteration. More specifically, the calculated value {circumflex over (x)}k(+) in equation 162 is substituted into equation 151 for the next iteration and the calculated value xcexa3e,k(+) in equation 163 is substituted into equation 152 for the next iteration. The Kalman filter thus iteratively predicts and corrects the internal states and its associated uncertainty. It must be noted that in practice, both A, B, C, D, xcexa3w and xcexa3v might change in each time step.
Extended Kalman Filter
Whereas the Kalman filter uses linear functions in its model, the Extended Kalman filter was developed to model system with non-linear functions. Aside from this distinction, the mathematical basis and operation for the Extended Kalman filter are essentially the same as the Kalman filter. The Extended Kalman filter uses an approximation model similar to the Taylor series to linearize the functions to obtain the estimation. The linearization is accomplished by taking the partial derivatives of the now non-linear process and measurement functions, the basis for the two equations in the predict component.
The Extended Kalman filter is governed by the following equations
xk+1=ƒ(xk,uk,wk)xe2x80x83xe2x80x83(10)
and
yk+1=h(xk,uk,vk)xe2x80x83xe2x80x83(11)
where random variables wk and vk represent process noise and measurement noise, respectively. Non-linear function ƒ in equation (10) relates the internal state vector xk at the current step k to the internal state vector xk+1 at the next time step k +I. Function ƒ also includes as parameters both the driving function uk and the process noise wk. The non-linear function h in equation (11) relates the internal state vector xk and input uk to the measurement yk.
FIG. 2A and FIG. 2B show the equations of the Extended Kalman Filter. The sequence of operation remains the same as the Kalman filter. There are still two componentsxe2x80x94predict component 201 and correct component 202. The equations are slightly different. Specifically, matrices A and C now have a time step sub-script k meaning that they change at each time step. This change is needed because the functions are now non-linear. We can no longer assume that the matrices are constant as in the case of the Kalman filter. To approximate them, Jacobian matrices are computed by taking partial derivatives of functions ƒ and h at each time step. The Jacobian matrices are listed below.
A is the Jacobian matrix computed by taking the partial derivative of ƒ with respect to x, that is                                                         A                                                [                                      i                    ,                    j                                    ]                                k                                      =                                          ∂                                  f                                      [                    i                    ]                                                                              ∂                                  x                                      [                    j                    ]                                                                                "RightBracketingBar"                                      x            k                    =                                    x              ^                        k                                              (        12        )            
The notation means xe2x80x9cwith xk evaluated as, or replaced by, {circumflex over (x)}k in final result.xe2x80x9d
C is the Jacobian matrix computed by taking the partial derivative of h with respect to x, that is                                                         C                                                [                                      i                    ,                    j                                    ]                                k                                      =                                          ∂                                  h                                      [                    i                    ]                                                                              ∂                                  x                                      [                    j                    ]                                                                                "RightBracketingBar"                                      x            k                    =                                    x              ^                        k                                              (        13        )            
Aside from these additional steps of taking partial derivatives of functions, the operation of the Extended Kalman filter remains essentially the same as the Kalman filter.
Using Kalman Filter to Determine the SOC in Batteries
Because it only has to measure the battery output, the Kalman filter has an advantage in that it works on all types of batteries system, including dynamic applications such as HEV and EV. There are existing applications that use the Kalman filter to determine SOC of batteries. However, none of them uses SOC as an internal state of the model. Thus the uncertainty associated with the SOC estimation cannot be determined. The defect is particularly important in HEV and EV batteries where the uncertainty range is needed to prevent undercharging of battery or loss of vehicle power. Also none of the existing methods uses the Extended Kalman filter to model battery SOC non-linearly.
It is important to note that as the Kalman filter is only a generic model. Each application of the Kalman filter still needs to use a good specific battery model and initial parameters that accurately describe the behavior of the battery to estimate the SOC. For example, to use the Kalman filter to measure the SOC as an internal state, the filter needs to have a specific equation describing how the SOC transitions from one time step to the next. The determination of such an equation is not trivial.
The present invention relates to an implementation of a battery State of Charge (SOC) estimator for any battery-powered application. The batteries may be either primary type or secondary (rechargeable) type. Moreover, the invention may be applied to any battery chemistry. It addresses the problems associated with the existing implementations such as high error uncertainty, limited range of applications (i.e. only one type of battery) and susceptibility to change in temperature.
Embodiments of the present invention use a Kalman filter, a linear algorithm, with a battery model that has SOC as an internal system state. Embodiments of the present invention use an Extended Kalman filter, a non-linear algorithm, with a battery model that has SOC as an internal system state. Having SOC as an internal state allows the invention to provide an uncertainty associated with its SOC estimation. Embodiments of the present invention do not take battery temperature as a parameter in its SOC estimation. Other embodiments of the present invention use battery temperature as a parameter to adjust its SOC estimation. This is important to keep the accuracy of the SOC estimation from being affected by changing temperature.
One embodiment has the option of allowing different modeling parameters during battery operation to accommodate highly dynamic batteries used in Hybrid Electric Vehicle (HEV) and Electric Vehicle (EV) where such previous implementations were difficult.